import request from '@/utils/request'

const api = {
  getBarcodeRulePageUrl: '/kc_barcode_rule/get_barcode_rule_page',
  getBarcodeRuleDetailUrl: '/kc_barcode_rule/get_barcode_rule_detail',
  addBarcodeRuleUrl: '/kc_barcode_rule/add_barcode_rule',
  updateBarcodeRuleUrl: '/kc_barcode_rule/update_barcode_rule',
  barcodeRuleFpUrl: '/kc_barcode_rule/barcode_rule_fp',
  getBarcodeRuleFpUrl: '/kc_barcode_rule/get_barcode_rule_fp',
}

export async function getBarcodeRuleFpApi(params: Map<string, any>) {
  const res = await request({
    url: api.getBarcodeRuleFpUrl,
    method: 'post',
    data: params,
  })
  return res
}

export async function barcodeRuleFpApi(params: Map<string, any>) {
  const res = await request({
    url: api.barcodeRuleFpUrl,
    method: 'post',
    data: params,
  })
  return res
}

export async function updateBarcodeRuleApi(params: Map<string, any>) {
  const res = await request({
    url: api.updateBarcodeRuleUrl,
    method: 'post',
    data: params,
  })
  return res
}

export async function addBarcodeRuleApi(params: Map<string, any>) {
  const res = await request({
    url: api.addBarcodeRuleUrl,
    method: 'post',
    data: params,
  })
  return res
}

export async function getBarcodeRuleDetailApi(params: Map<string, any>) {
  const res = await request({
    url: api.getBarcodeRuleDetailUrl,
    method: 'get',
    params: params,
  })
  return res
}

export async function getBarcodeRulePageApi(params: Map<string, any>) {
  const res = await request({
    url: api.getBarcodeRulePageUrl,
    method: 'post',
    data: params,
  })
  return res
}
